// $ANTLR 3.4 /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g 2011-11-17 09:17:47

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.debug.*;
import java.io.IOException;
import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class MiniPnASTParser extends DebugParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "BOOL", "COMMENT", "CONDITION", "DECLA", "DECLARATION", "DO", "ELSE", "ID", "IF", "LINEOP", "NUMBER", "PCLOSED", "POINTOP", "POPEN", "PRINT", "READ", "RELOP", "SEMI", "STRING", "THEN", "WHILE", "','", "'.'", "'begin'", "'boolean'", "'do'", "'else'", "'end'", "'fi'", "'if'", "'integer'", "'od'", "'println'", "'program'", "'read'", "'real'", "'string'", "'then'", "'while'"
    };

    public static final int EOF=-1;
    public static final int T__25=25;
    public static final int T__26=26;
    public static final int T__27=27;
    public static final int T__28=28;
    public static final int T__29=29;
    public static final int T__30=30;
    public static final int T__31=31;
    public static final int T__32=32;
    public static final int T__33=33;
    public static final int T__34=34;
    public static final int T__35=35;
    public static final int T__36=36;
    public static final int T__37=37;
    public static final int T__38=38;
    public static final int T__39=39;
    public static final int T__40=40;
    public static final int T__41=41;
    public static final int T__42=42;
    public static final int BOOL=4;
    public static final int COMMENT=5;
    public static final int CONDITION=6;
    public static final int DECLA=7;
    public static final int DECLARATION=8;
    public static final int DO=9;
    public static final int ELSE=10;
    public static final int ID=11;
    public static final int IF=12;
    public static final int LINEOP=13;
    public static final int NUMBER=14;
    public static final int PCLOSED=15;
    public static final int POINTOP=16;
    public static final int POPEN=17;
    public static final int PRINT=18;
    public static final int READ=19;
    public static final int RELOP=20;
    public static final int SEMI=21;
    public static final int STRING=22;
    public static final int THEN=23;
    public static final int WHILE=24;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


public static final String[] ruleNames = new String[] {
    "invalidRule", "atom", "stringConst", "prog", "declaration", "assignment", 
    "comparison", "readStat", "statement", "ifStat", "intConst", "realConst", 
    "arithExpr", "whileStat", "printStat", "constant", "pointExpr"
};

public static final boolean[] decisionCanBacktrack = new boolean[] {
    false, // invalid decision
    false, false, false, false, false, false, false, false, false, false, 
        false, false, false, false, false, false, false, false, false, false, 
        false
};

 
    public int ruleLevel = 0;
    public int getRuleLevel() { return ruleLevel; }
    public void incRuleLevel() { ruleLevel++; }
    public void decRuleLevel() { ruleLevel--; }
    public MiniPnASTParser(TokenStream input) {
        this(input, DebugEventSocketProxy.DEFAULT_DEBUGGER_PORT, new RecognizerSharedState());
    }
    public MiniPnASTParser(TokenStream input, int port, RecognizerSharedState state) {
        super(input, state);
        DebugEventSocketProxy proxy =
            new DebugEventSocketProxy(this,port,adaptor);
        setDebugListener(proxy);
        setTokenStream(new DebugTokenStream(input,proxy));
        try {
            proxy.handshake();
        }
        catch (IOException ioe) {
            reportError(ioe);
        }
        TreeAdaptor adap = new CommonTreeAdaptor();
        setTreeAdaptor(adap);
        proxy.setTreeAdaptor(adap);
    }

public MiniPnASTParser(TokenStream input, DebugEventListener dbg) {
    super(input, dbg);
     
    TreeAdaptor adap = new CommonTreeAdaptor();
    setTreeAdaptor(adap);


}

protected boolean evalPredicate(boolean result, String predicate) {
    dbg.semanticPredicate(result, predicate);
    return result;
}

protected DebugTreeAdaptor adaptor;
public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = new DebugTreeAdaptor(dbg,adaptor);


}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}

    public String[] getTokenNames() { return MiniPnASTParser.tokenNames; }
    public String getGrammarFileName() { return "/Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g"; }


    public static class prog_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "prog"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:1: prog : ( 'program' ( declaration )* 'begin' ( statement )* 'end' ) -> ( declaration )* ( statement )* ;
    public final MiniPnASTParser.prog_return prog() throws RecognitionException {
        MiniPnASTParser.prog_return retval = new MiniPnASTParser.prog_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token string_literal1=null;
        Token string_literal3=null;
        Token string_literal5=null;
        MiniPnASTParser.declaration_return declaration2 =null;

        MiniPnASTParser.statement_return statement4 =null;


        CommonTree string_literal1_tree=null;
        CommonTree string_literal3_tree=null;
        CommonTree string_literal5_tree=null;
        RewriteRuleTokenStream stream_31=new RewriteRuleTokenStream(adaptor,"token 31");
        RewriteRuleTokenStream stream_27=new RewriteRuleTokenStream(adaptor,"token 27");
        RewriteRuleTokenStream stream_37=new RewriteRuleTokenStream(adaptor,"token 37");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_declaration=new RewriteRuleSubtreeStream(adaptor,"rule declaration");
        try { dbg.enterRule(getGrammarFileName(), "prog");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(18, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:7: ( ( 'program' ( declaration )* 'begin' ( statement )* 'end' ) -> ( declaration )* ( statement )* )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:9: ( 'program' ( declaration )* 'begin' ( statement )* 'end' )
            {
            dbg.location(18,9);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:9: ( 'program' ( declaration )* 'begin' ( statement )* 'end' )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:10: 'program' ( declaration )* 'begin' ( statement )* 'end'
            {
            dbg.location(18,10);
            string_literal1=(Token)match(input,37,FOLLOW_37_in_prog60);  
            stream_37.add(string_literal1);

            dbg.location(18,20);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:20: ( declaration )*
            try { dbg.enterSubRule(1);

            loop1:
            do {
                int alt1=2;
                try { dbg.enterDecision(1, decisionCanBacktrack[1]);

                int LA1_0 = input.LA(1);

                if ( (LA1_0==28||LA1_0==34||(LA1_0 >= 39 && LA1_0 <= 40)) ) {
                    alt1=1;
                }


                } finally {dbg.exitDecision(1);}

                switch (alt1) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:21: declaration
            	    {
            	    dbg.location(18,21);
            	    pushFollow(FOLLOW_declaration_in_prog63);
            	    declaration2=declaration();

            	    state._fsp--;

            	    stream_declaration.add(declaration2.getTree());

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);
            } finally {dbg.exitSubRule(1);}

            dbg.location(18,35);
            string_literal3=(Token)match(input,27,FOLLOW_27_in_prog67);  
            stream_27.add(string_literal3);

            dbg.location(18,43);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:43: ( statement )*
            try { dbg.enterSubRule(2);

            loop2:
            do {
                int alt2=2;
                try { dbg.enterDecision(2, decisionCanBacktrack[2]);

                int LA2_0 = input.LA(1);

                if ( (LA2_0==ID||LA2_0==33||LA2_0==36||LA2_0==38||LA2_0==42) ) {
                    alt2=1;
                }


                } finally {dbg.exitDecision(2);}

                switch (alt2) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:18:44: statement
            	    {
            	    dbg.location(18,44);
            	    pushFollow(FOLLOW_statement_in_prog70);
            	    statement4=statement();

            	    state._fsp--;

            	    stream_statement.add(statement4.getTree());

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);
            } finally {dbg.exitSubRule(2);}

            dbg.location(18,56);
            string_literal5=(Token)match(input,31,FOLLOW_31_in_prog74);  
            stream_31.add(string_literal5);


            }


            // AST REWRITE
            // elements: declaration, statement
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 19:3: -> ( declaration )* ( statement )*
            {
                dbg.location(19,6);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:19:6: ( declaration )*
                while ( stream_declaration.hasNext() ) {
                    dbg.location(19,6);
                    adaptor.addChild(root_0, stream_declaration.nextTree());

                }
                stream_declaration.reset();
                dbg.location(19,19);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:19:19: ( statement )*
                while ( stream_statement.hasNext() ) {
                    dbg.location(19,19);
                    adaptor.addChild(root_0, stream_statement.nextTree());

                }
                stream_statement.reset();

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(19, 29);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "prog");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "prog"


    public static class declaration_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "declaration"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:1: declaration : (i= 'integer' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $i ID ) )+ |b= 'boolean' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $b ID ) )+ |s= 'string' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $s ID ) )+ |r= 'real' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $r ID ) )+ );
    public final MiniPnASTParser.declaration_return declaration() throws RecognitionException {
        MiniPnASTParser.declaration_return retval = new MiniPnASTParser.declaration_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token i=null;
        Token b=null;
        Token s=null;
        Token r=null;
        Token ID6=null;
        Token char_literal7=null;
        Token ID8=null;
        Token SEMI9=null;
        Token ID10=null;
        Token char_literal11=null;
        Token ID12=null;
        Token SEMI13=null;
        Token ID14=null;
        Token char_literal15=null;
        Token ID16=null;
        Token SEMI17=null;
        Token ID18=null;
        Token char_literal19=null;
        Token ID20=null;
        Token SEMI21=null;

        CommonTree i_tree=null;
        CommonTree b_tree=null;
        CommonTree s_tree=null;
        CommonTree r_tree=null;
        CommonTree ID6_tree=null;
        CommonTree char_literal7_tree=null;
        CommonTree ID8_tree=null;
        CommonTree SEMI9_tree=null;
        CommonTree ID10_tree=null;
        CommonTree char_literal11_tree=null;
        CommonTree ID12_tree=null;
        CommonTree SEMI13_tree=null;
        CommonTree ID14_tree=null;
        CommonTree char_literal15_tree=null;
        CommonTree ID16_tree=null;
        CommonTree SEMI17_tree=null;
        CommonTree ID18_tree=null;
        CommonTree char_literal19_tree=null;
        CommonTree ID20_tree=null;
        CommonTree SEMI21_tree=null;
        RewriteRuleTokenStream stream_40=new RewriteRuleTokenStream(adaptor,"token 40");
        RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_SEMI=new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
        RewriteRuleTokenStream stream_34=new RewriteRuleTokenStream(adaptor,"token 34");
        RewriteRuleTokenStream stream_39=new RewriteRuleTokenStream(adaptor,"token 39");
        RewriteRuleTokenStream stream_28=new RewriteRuleTokenStream(adaptor,"token 28");

        try { dbg.enterRule(getGrammarFileName(), "declaration");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(26, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:12: (i= 'integer' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $i ID ) )+ |b= 'boolean' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $b ID ) )+ |s= 'string' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $s ID ) )+ |r= 'real' ID ( ',' ID )* SEMI -> ( ^( DECLARATION $r ID ) )+ )
            int alt7=4;
            try { dbg.enterDecision(7, decisionCanBacktrack[7]);

            switch ( input.LA(1) ) {
            case 34:
                {
                alt7=1;
                }
                break;
            case 28:
                {
                alt7=2;
                }
                break;
            case 40:
                {
                alt7=3;
                }
                break;
            case 39:
                {
                alt7=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }

            } finally {dbg.exitDecision(7);}

            switch (alt7) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:15: i= 'integer' ID ( ',' ID )* SEMI
                    {
                    dbg.location(26,16);
                    i=(Token)match(input,34,FOLLOW_34_in_declaration102);  
                    stream_34.add(i);

                    dbg.location(26,28);
                    ID6=(Token)match(input,ID,FOLLOW_ID_in_declaration105);  
                    stream_ID.add(ID6);

                    dbg.location(26,30);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:30: ( ',' ID )*
                    try { dbg.enterSubRule(3);

                    loop3:
                    do {
                        int alt3=2;
                        try { dbg.enterDecision(3, decisionCanBacktrack[3]);

                        int LA3_0 = input.LA(1);

                        if ( (LA3_0==25) ) {
                            alt3=1;
                        }


                        } finally {dbg.exitDecision(3);}

                        switch (alt3) {
                    	case 1 :
                    	    dbg.enterAlt(1);

                    	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:31: ',' ID
                    	    {
                    	    dbg.location(26,31);
                    	    char_literal7=(Token)match(input,25,FOLLOW_25_in_declaration107);  
                    	    stream_25.add(char_literal7);

                    	    dbg.location(26,34);
                    	    ID8=(Token)match(input,ID,FOLLOW_ID_in_declaration108);  
                    	    stream_ID.add(ID8);


                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);
                    } finally {dbg.exitSubRule(3);}

                    dbg.location(26,39);
                    SEMI9=(Token)match(input,SEMI,FOLLOW_SEMI_in_declaration112);  
                    stream_SEMI.add(SEMI9);


                    // AST REWRITE
                    // elements: i, ID
                    // token labels: i
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleTokenStream stream_i=new RewriteRuleTokenStream(adaptor,"token i",i);
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 26:44: -> ( ^( DECLARATION $i ID ) )+
                    {
                        dbg.location(26,47);
                        if ( !(stream_i.hasNext()||stream_ID.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_i.hasNext()||stream_ID.hasNext() ) {
                            dbg.location(26,47);
                            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:26:47: ^( DECLARATION $i ID )
                            {
                            CommonTree root_1 = (CommonTree)adaptor.nil();
                            dbg.location(26,49);
                            root_1 = (CommonTree)adaptor.becomeRoot(
                            (CommonTree)adaptor.create(DECLARATION, "DECLARATION")
                            , root_1);

                            dbg.location(26,62);
                            adaptor.addChild(root_1, stream_i.nextNode());
                            dbg.location(26,64);
                            adaptor.addChild(root_1, 
                            stream_ID.nextNode()
                            );

                            adaptor.addChild(root_0, root_1);
                            }

                        }
                        stream_i.reset();
                        stream_ID.reset();

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:27:4: b= 'boolean' ID ( ',' ID )* SEMI
                    {
                    dbg.location(27,5);
                    b=(Token)match(input,28,FOLLOW_28_in_declaration131);  
                    stream_28.add(b);

                    dbg.location(27,17);
                    ID10=(Token)match(input,ID,FOLLOW_ID_in_declaration134);  
                    stream_ID.add(ID10);

                    dbg.location(27,19);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:27:19: ( ',' ID )*
                    try { dbg.enterSubRule(4);

                    loop4:
                    do {
                        int alt4=2;
                        try { dbg.enterDecision(4, decisionCanBacktrack[4]);

                        int LA4_0 = input.LA(1);

                        if ( (LA4_0==25) ) {
                            alt4=1;
                        }


                        } finally {dbg.exitDecision(4);}

                        switch (alt4) {
                    	case 1 :
                    	    dbg.enterAlt(1);

                    	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:27:20: ',' ID
                    	    {
                    	    dbg.location(27,20);
                    	    char_literal11=(Token)match(input,25,FOLLOW_25_in_declaration136);  
                    	    stream_25.add(char_literal11);

                    	    dbg.location(27,23);
                    	    ID12=(Token)match(input,ID,FOLLOW_ID_in_declaration137);  
                    	    stream_ID.add(ID12);


                    	    }
                    	    break;

                    	default :
                    	    break loop4;
                        }
                    } while (true);
                    } finally {dbg.exitSubRule(4);}

                    dbg.location(27,28);
                    SEMI13=(Token)match(input,SEMI,FOLLOW_SEMI_in_declaration141);  
                    stream_SEMI.add(SEMI13);


                    // AST REWRITE
                    // elements: b, ID
                    // token labels: b
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleTokenStream stream_b=new RewriteRuleTokenStream(adaptor,"token b",b);
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 27:33: -> ( ^( DECLARATION $b ID ) )+
                    {
                        dbg.location(27,35);
                        if ( !(stream_b.hasNext()||stream_ID.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_b.hasNext()||stream_ID.hasNext() ) {
                            dbg.location(27,35);
                            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:27:35: ^( DECLARATION $b ID )
                            {
                            CommonTree root_1 = (CommonTree)adaptor.nil();
                            dbg.location(27,37);
                            root_1 = (CommonTree)adaptor.becomeRoot(
                            (CommonTree)adaptor.create(DECLARATION, "DECLARATION")
                            , root_1);

                            dbg.location(27,50);
                            adaptor.addChild(root_1, stream_b.nextNode());
                            dbg.location(27,52);
                            adaptor.addChild(root_1, 
                            stream_ID.nextNode()
                            );

                            adaptor.addChild(root_0, root_1);
                            }

                        }
                        stream_b.reset();
                        stream_ID.reset();

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 3 :
                    dbg.enterAlt(3);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:28:4: s= 'string' ID ( ',' ID )* SEMI
                    {
                    dbg.location(28,5);
                    s=(Token)match(input,40,FOLLOW_40_in_declaration159);  
                    stream_40.add(s);

                    dbg.location(28,16);
                    ID14=(Token)match(input,ID,FOLLOW_ID_in_declaration162);  
                    stream_ID.add(ID14);

                    dbg.location(28,18);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:28:18: ( ',' ID )*
                    try { dbg.enterSubRule(5);

                    loop5:
                    do {
                        int alt5=2;
                        try { dbg.enterDecision(5, decisionCanBacktrack[5]);

                        int LA5_0 = input.LA(1);

                        if ( (LA5_0==25) ) {
                            alt5=1;
                        }


                        } finally {dbg.exitDecision(5);}

                        switch (alt5) {
                    	case 1 :
                    	    dbg.enterAlt(1);

                    	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:28:19: ',' ID
                    	    {
                    	    dbg.location(28,19);
                    	    char_literal15=(Token)match(input,25,FOLLOW_25_in_declaration164);  
                    	    stream_25.add(char_literal15);

                    	    dbg.location(28,22);
                    	    ID16=(Token)match(input,ID,FOLLOW_ID_in_declaration165);  
                    	    stream_ID.add(ID16);


                    	    }
                    	    break;

                    	default :
                    	    break loop5;
                        }
                    } while (true);
                    } finally {dbg.exitSubRule(5);}

                    dbg.location(28,27);
                    SEMI17=(Token)match(input,SEMI,FOLLOW_SEMI_in_declaration169);  
                    stream_SEMI.add(SEMI17);


                    // AST REWRITE
                    // elements: ID, s
                    // token labels: s
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleTokenStream stream_s=new RewriteRuleTokenStream(adaptor,"token s",s);
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 28:32: -> ( ^( DECLARATION $s ID ) )+
                    {
                        dbg.location(28,34);
                        if ( !(stream_ID.hasNext()||stream_s.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_ID.hasNext()||stream_s.hasNext() ) {
                            dbg.location(28,34);
                            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:28:34: ^( DECLARATION $s ID )
                            {
                            CommonTree root_1 = (CommonTree)adaptor.nil();
                            dbg.location(28,36);
                            root_1 = (CommonTree)adaptor.becomeRoot(
                            (CommonTree)adaptor.create(DECLARATION, "DECLARATION")
                            , root_1);

                            dbg.location(28,49);
                            adaptor.addChild(root_1, stream_s.nextNode());
                            dbg.location(28,51);
                            adaptor.addChild(root_1, 
                            stream_ID.nextNode()
                            );

                            adaptor.addChild(root_0, root_1);
                            }

                        }
                        stream_ID.reset();
                        stream_s.reset();

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 4 :
                    dbg.enterAlt(4);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:29:4: r= 'real' ID ( ',' ID )* SEMI
                    {
                    dbg.location(29,5);
                    r=(Token)match(input,39,FOLLOW_39_in_declaration187);  
                    stream_39.add(r);

                    dbg.location(29,14);
                    ID18=(Token)match(input,ID,FOLLOW_ID_in_declaration190);  
                    stream_ID.add(ID18);

                    dbg.location(29,16);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:29:16: ( ',' ID )*
                    try { dbg.enterSubRule(6);

                    loop6:
                    do {
                        int alt6=2;
                        try { dbg.enterDecision(6, decisionCanBacktrack[6]);

                        int LA6_0 = input.LA(1);

                        if ( (LA6_0==25) ) {
                            alt6=1;
                        }


                        } finally {dbg.exitDecision(6);}

                        switch (alt6) {
                    	case 1 :
                    	    dbg.enterAlt(1);

                    	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:29:17: ',' ID
                    	    {
                    	    dbg.location(29,17);
                    	    char_literal19=(Token)match(input,25,FOLLOW_25_in_declaration192);  
                    	    stream_25.add(char_literal19);

                    	    dbg.location(29,20);
                    	    ID20=(Token)match(input,ID,FOLLOW_ID_in_declaration193);  
                    	    stream_ID.add(ID20);


                    	    }
                    	    break;

                    	default :
                    	    break loop6;
                        }
                    } while (true);
                    } finally {dbg.exitSubRule(6);}

                    dbg.location(29,25);
                    SEMI21=(Token)match(input,SEMI,FOLLOW_SEMI_in_declaration197);  
                    stream_SEMI.add(SEMI21);


                    // AST REWRITE
                    // elements: ID, r
                    // token labels: r
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleTokenStream stream_r=new RewriteRuleTokenStream(adaptor,"token r",r);
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 29:30: -> ( ^( DECLARATION $r ID ) )+
                    {
                        dbg.location(29,32);
                        if ( !(stream_ID.hasNext()||stream_r.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_ID.hasNext()||stream_r.hasNext() ) {
                            dbg.location(29,32);
                            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:29:32: ^( DECLARATION $r ID )
                            {
                            CommonTree root_1 = (CommonTree)adaptor.nil();
                            dbg.location(29,34);
                            root_1 = (CommonTree)adaptor.becomeRoot(
                            (CommonTree)adaptor.create(DECLARATION, "DECLARATION")
                            , root_1);

                            dbg.location(29,47);
                            adaptor.addChild(root_1, stream_r.nextNode());
                            dbg.location(29,49);
                            adaptor.addChild(root_1, 
                            stream_ID.nextNode()
                            );

                            adaptor.addChild(root_0, root_1);
                            }

                        }
                        stream_ID.reset();
                        stream_r.reset();

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(31, 0);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "declaration");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "declaration"


    public static class statement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "statement"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:34:1: statement : ( assignment | ifStat | whileStat | readStat | printStat );
    public final MiniPnASTParser.statement_return statement() throws RecognitionException {
        MiniPnASTParser.statement_return retval = new MiniPnASTParser.statement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        MiniPnASTParser.assignment_return assignment22 =null;

        MiniPnASTParser.ifStat_return ifStat23 =null;

        MiniPnASTParser.whileStat_return whileStat24 =null;

        MiniPnASTParser.readStat_return readStat25 =null;

        MiniPnASTParser.printStat_return printStat26 =null;



        try { dbg.enterRule(getGrammarFileName(), "statement");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(34, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:34:10: ( assignment | ifStat | whileStat | readStat | printStat )
            int alt8=5;
            try { dbg.enterDecision(8, decisionCanBacktrack[8]);

            switch ( input.LA(1) ) {
            case ID:
                {
                alt8=1;
                }
                break;
            case 33:
                {
                alt8=2;
                }
                break;
            case 42:
                {
                alt8=3;
                }
                break;
            case 38:
                {
                alt8=4;
                }
                break;
            case 36:
                {
                alt8=5;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 8, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }

            } finally {dbg.exitDecision(8);}

            switch (alt8) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:34:12: assignment
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(34,12);
                    pushFollow(FOLLOW_assignment_in_statement218);
                    assignment22=assignment();

                    state._fsp--;

                    adaptor.addChild(root_0, assignment22.getTree());

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:35:5: ifStat
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(35,5);
                    pushFollow(FOLLOW_ifStat_in_statement224);
                    ifStat23=ifStat();

                    state._fsp--;

                    adaptor.addChild(root_0, ifStat23.getTree());

                    }
                    break;
                case 3 :
                    dbg.enterAlt(3);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:36:12: whileStat
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(36,12);
                    pushFollow(FOLLOW_whileStat_in_statement237);
                    whileStat24=whileStat();

                    state._fsp--;

                    adaptor.addChild(root_0, whileStat24.getTree());

                    }
                    break;
                case 4 :
                    dbg.enterAlt(4);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:37:6: readStat
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(37,6);
                    pushFollow(FOLLOW_readStat_in_statement244);
                    readStat25=readStat();

                    state._fsp--;

                    adaptor.addChild(root_0, readStat25.getTree());

                    }
                    break;
                case 5 :
                    dbg.enterAlt(5);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:38:5: printStat
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(38,5);
                    pushFollow(FOLLOW_printStat_in_statement250);
                    printStat26=printStat();

                    state._fsp--;

                    adaptor.addChild(root_0, printStat26.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(39, 2);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "statement");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "statement"


    public static class assignment_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "assignment"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:1: assignment : ( ID DECLA ( stringConst ) -> ^( DECLA ID stringConst ) | ID DECLA ( comparison ) -> ^( DECLA ID comparison ) | ID DECLA ( arithExpr ) -> ^( DECLA ID arithExpr ) );
    public final MiniPnASTParser.assignment_return assignment() throws RecognitionException {
        MiniPnASTParser.assignment_return retval = new MiniPnASTParser.assignment_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ID27=null;
        Token DECLA28=null;
        Token ID30=null;
        Token DECLA31=null;
        Token ID33=null;
        Token DECLA34=null;
        MiniPnASTParser.stringConst_return stringConst29 =null;

        MiniPnASTParser.comparison_return comparison32 =null;

        MiniPnASTParser.arithExpr_return arithExpr35 =null;


        CommonTree ID27_tree=null;
        CommonTree DECLA28_tree=null;
        CommonTree ID30_tree=null;
        CommonTree DECLA31_tree=null;
        CommonTree ID33_tree=null;
        CommonTree DECLA34_tree=null;
        RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_DECLA=new RewriteRuleTokenStream(adaptor,"token DECLA");
        RewriteRuleSubtreeStream stream_arithExpr=new RewriteRuleSubtreeStream(adaptor,"rule arithExpr");
        RewriteRuleSubtreeStream stream_comparison=new RewriteRuleSubtreeStream(adaptor,"rule comparison");
        RewriteRuleSubtreeStream stream_stringConst=new RewriteRuleSubtreeStream(adaptor,"rule stringConst");
        try { dbg.enterRule(getGrammarFileName(), "assignment");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(42, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:11: ( ID DECLA ( stringConst ) -> ^( DECLA ID stringConst ) | ID DECLA ( comparison ) -> ^( DECLA ID comparison ) | ID DECLA ( arithExpr ) -> ^( DECLA ID arithExpr ) )
            int alt9=3;
            try { dbg.enterDecision(9, decisionCanBacktrack[9]);

            try {
                isCyclicDecision = true;
                alt9 = dfa9.predict(input);
            }
            catch (NoViableAltException nvae) {
                dbg.recognitionException(nvae);
                throw nvae;
            }
            } finally {dbg.exitDecision(9);}

            switch (alt9) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:13: ID DECLA ( stringConst )
                    {
                    dbg.location(42,13);
                    ID27=(Token)match(input,ID,FOLLOW_ID_in_assignment261);  
                    stream_ID.add(ID27);

                    dbg.location(42,16);
                    DECLA28=(Token)match(input,DECLA,FOLLOW_DECLA_in_assignment263);  
                    stream_DECLA.add(DECLA28);

                    dbg.location(42,22);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:22: ( stringConst )
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:23: stringConst
                    {
                    dbg.location(42,23);
                    pushFollow(FOLLOW_stringConst_in_assignment266);
                    stringConst29=stringConst();

                    state._fsp--;

                    stream_stringConst.add(stringConst29.getTree());

                    }


                    // AST REWRITE
                    // elements: stringConst, ID, DECLA
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 42:38: -> ^( DECLA ID stringConst )
                    {
                        dbg.location(42,40);
                        // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:42:40: ^( DECLA ID stringConst )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        dbg.location(42,42);
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        stream_DECLA.nextNode()
                        , root_1);

                        dbg.location(42,48);
                        adaptor.addChild(root_1, 
                        stream_ID.nextNode()
                        );
                        dbg.location(42,51);
                        adaptor.addChild(root_1, stream_stringConst.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:43:4: ID DECLA ( comparison )
                    {
                    dbg.location(43,4);
                    ID30=(Token)match(input,ID,FOLLOW_ID_in_assignment283);  
                    stream_ID.add(ID30);

                    dbg.location(43,7);
                    DECLA31=(Token)match(input,DECLA,FOLLOW_DECLA_in_assignment285);  
                    stream_DECLA.add(DECLA31);

                    dbg.location(43,13);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:43:13: ( comparison )
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:43:14: comparison
                    {
                    dbg.location(43,14);
                    pushFollow(FOLLOW_comparison_in_assignment288);
                    comparison32=comparison();

                    state._fsp--;

                    stream_comparison.add(comparison32.getTree());

                    }


                    // AST REWRITE
                    // elements: DECLA, comparison, ID
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 43:28: -> ^( DECLA ID comparison )
                    {
                        dbg.location(43,31);
                        // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:43:31: ^( DECLA ID comparison )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        dbg.location(43,33);
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        stream_DECLA.nextNode()
                        , root_1);

                        dbg.location(43,39);
                        adaptor.addChild(root_1, 
                        stream_ID.nextNode()
                        );
                        dbg.location(43,42);
                        adaptor.addChild(root_1, stream_comparison.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 3 :
                    dbg.enterAlt(3);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:44:4: ID DECLA ( arithExpr )
                    {
                    dbg.location(44,4);
                    ID33=(Token)match(input,ID,FOLLOW_ID_in_assignment306);  
                    stream_ID.add(ID33);

                    dbg.location(44,7);
                    DECLA34=(Token)match(input,DECLA,FOLLOW_DECLA_in_assignment308);  
                    stream_DECLA.add(DECLA34);

                    dbg.location(44,13);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:44:13: ( arithExpr )
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:44:14: arithExpr
                    {
                    dbg.location(44,14);
                    pushFollow(FOLLOW_arithExpr_in_assignment311);
                    arithExpr35=arithExpr();

                    state._fsp--;

                    stream_arithExpr.add(arithExpr35.getTree());

                    }


                    // AST REWRITE
                    // elements: DECLA, arithExpr, ID
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 44:27: -> ^( DECLA ID arithExpr )
                    {
                        dbg.location(44,30);
                        // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:44:30: ^( DECLA ID arithExpr )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        dbg.location(44,32);
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        stream_DECLA.nextNode()
                        , root_1);

                        dbg.location(44,38);
                        adaptor.addChild(root_1, 
                        stream_ID.nextNode()
                        );
                        dbg.location(44,41);
                        adaptor.addChild(root_1, stream_arithExpr.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(44, 50);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "assignment");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "assignment"


    public static class arithExpr_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "arithExpr"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:51:1: arithExpr : pointExpr ( LINEOP pointExpr )* ;
    public final MiniPnASTParser.arithExpr_return arithExpr() throws RecognitionException {
        MiniPnASTParser.arithExpr_return retval = new MiniPnASTParser.arithExpr_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token LINEOP37=null;
        MiniPnASTParser.pointExpr_return pointExpr36 =null;

        MiniPnASTParser.pointExpr_return pointExpr38 =null;


        CommonTree LINEOP37_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "arithExpr");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(51, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:51:10: ( pointExpr ( LINEOP pointExpr )* )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:51:13: pointExpr ( LINEOP pointExpr )*
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(51,13);
            pushFollow(FOLLOW_pointExpr_in_arithExpr337);
            pointExpr36=pointExpr();

            state._fsp--;

            adaptor.addChild(root_0, pointExpr36.getTree());
            dbg.location(51,23);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:51:23: ( LINEOP pointExpr )*
            try { dbg.enterSubRule(10);

            loop10:
            do {
                int alt10=2;
                try { dbg.enterDecision(10, decisionCanBacktrack[10]);

                int LA10_0 = input.LA(1);

                if ( (LA10_0==LINEOP) ) {
                    alt10=1;
                }


                } finally {dbg.exitDecision(10);}

                switch (alt10) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:51:24: LINEOP pointExpr
            	    {
            	    dbg.location(51,24);
            	    LINEOP37=(Token)match(input,LINEOP,FOLLOW_LINEOP_in_arithExpr340); 
            	    LINEOP37_tree = 
            	    (CommonTree)adaptor.create(LINEOP37)
            	    ;
            	    adaptor.addChild(root_0, LINEOP37_tree);

            	    dbg.location(51,31);
            	    pushFollow(FOLLOW_pointExpr_in_arithExpr342);
            	    pointExpr38=pointExpr();

            	    state._fsp--;

            	    adaptor.addChild(root_0, pointExpr38.getTree());

            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);
            } finally {dbg.exitSubRule(10);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(51, 41);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "arithExpr");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "arithExpr"


    public static class pointExpr_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "pointExpr"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:52:1: pointExpr : atom ( POINTOP atom )* ;
    public final MiniPnASTParser.pointExpr_return pointExpr() throws RecognitionException {
        MiniPnASTParser.pointExpr_return retval = new MiniPnASTParser.pointExpr_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token POINTOP40=null;
        MiniPnASTParser.atom_return atom39 =null;

        MiniPnASTParser.atom_return atom41 =null;


        CommonTree POINTOP40_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "pointExpr");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(52, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:52:10: ( atom ( POINTOP atom )* )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:52:13: atom ( POINTOP atom )*
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(52,13);
            pushFollow(FOLLOW_atom_in_pointExpr351);
            atom39=atom();

            state._fsp--;

            adaptor.addChild(root_0, atom39.getTree());
            dbg.location(52,18);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:52:18: ( POINTOP atom )*
            try { dbg.enterSubRule(11);

            loop11:
            do {
                int alt11=2;
                try { dbg.enterDecision(11, decisionCanBacktrack[11]);

                int LA11_0 = input.LA(1);

                if ( (LA11_0==POINTOP) ) {
                    alt11=1;
                }


                } finally {dbg.exitDecision(11);}

                switch (alt11) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:52:19: POINTOP atom
            	    {
            	    dbg.location(52,19);
            	    POINTOP40=(Token)match(input,POINTOP,FOLLOW_POINTOP_in_pointExpr354); 
            	    POINTOP40_tree = 
            	    (CommonTree)adaptor.create(POINTOP40)
            	    ;
            	    adaptor.addChild(root_0, POINTOP40_tree);

            	    dbg.location(52,27);
            	    pushFollow(FOLLOW_atom_in_pointExpr356);
            	    atom41=atom();

            	    state._fsp--;

            	    adaptor.addChild(root_0, atom41.getTree());

            	    }
            	    break;

            	default :
            	    break loop11;
                }
            } while (true);
            } finally {dbg.exitSubRule(11);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(52, 33);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "pointExpr");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "pointExpr"


    public static class atom_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "atom"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:53:1: atom : ( intConst | ID | ( POPEN arithExpr PCLOSED ) );
    public final MiniPnASTParser.atom_return atom() throws RecognitionException {
        MiniPnASTParser.atom_return retval = new MiniPnASTParser.atom_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ID43=null;
        Token POPEN44=null;
        Token PCLOSED46=null;
        MiniPnASTParser.intConst_return intConst42 =null;

        MiniPnASTParser.arithExpr_return arithExpr45 =null;


        CommonTree ID43_tree=null;
        CommonTree POPEN44_tree=null;
        CommonTree PCLOSED46_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "atom");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(53, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:53:6: ( intConst | ID | ( POPEN arithExpr PCLOSED ) )
            int alt12=3;
            try { dbg.enterDecision(12, decisionCanBacktrack[12]);

            switch ( input.LA(1) ) {
            case NUMBER:
                {
                alt12=1;
                }
                break;
            case ID:
                {
                alt12=2;
                }
                break;
            case POPEN:
                {
                alt12=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 12, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }

            } finally {dbg.exitDecision(12);}

            switch (alt12) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:53:8: intConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(53,8);
                    pushFollow(FOLLOW_intConst_in_atom366);
                    intConst42=intConst();

                    state._fsp--;

                    adaptor.addChild(root_0, intConst42.getTree());

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:54:4: ID
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(54,4);
                    ID43=(Token)match(input,ID,FOLLOW_ID_in_atom371); 
                    ID43_tree = 
                    (CommonTree)adaptor.create(ID43)
                    ;
                    adaptor.addChild(root_0, ID43_tree);


                    }
                    break;
                case 3 :
                    dbg.enterAlt(3);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:55:5: ( POPEN arithExpr PCLOSED )
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(55,5);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:55:5: ( POPEN arithExpr PCLOSED )
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:55:6: POPEN arithExpr PCLOSED
                    {
                    dbg.location(55,6);
                    POPEN44=(Token)match(input,POPEN,FOLLOW_POPEN_in_atom379); 
                    POPEN44_tree = 
                    (CommonTree)adaptor.create(POPEN44)
                    ;
                    adaptor.addChild(root_0, POPEN44_tree);

                    dbg.location(55,12);
                    pushFollow(FOLLOW_arithExpr_in_atom381);
                    arithExpr45=arithExpr();

                    state._fsp--;

                    adaptor.addChild(root_0, arithExpr45.getTree());
                    dbg.location(55,22);
                    PCLOSED46=(Token)match(input,PCLOSED,FOLLOW_PCLOSED_in_atom383); 
                    PCLOSED46_tree = 
                    (CommonTree)adaptor.create(PCLOSED46)
                    ;
                    adaptor.addChild(root_0, PCLOSED46_tree);


                    }


                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(56, 1);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "atom");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "atom"


    public static class comparison_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "comparison"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:60:1: comparison : ( ID | constant ) RELOP ( ID | constant ) ;
    public final MiniPnASTParser.comparison_return comparison() throws RecognitionException {
        MiniPnASTParser.comparison_return retval = new MiniPnASTParser.comparison_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ID47=null;
        Token RELOP49=null;
        Token ID50=null;
        MiniPnASTParser.constant_return constant48 =null;

        MiniPnASTParser.constant_return constant51 =null;


        CommonTree ID47_tree=null;
        CommonTree RELOP49_tree=null;
        CommonTree ID50_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "comparison");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(60, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:60:11: ( ( ID | constant ) RELOP ( ID | constant ) )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:2: ( ID | constant ) RELOP ( ID | constant )
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(61,2);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:2: ( ID | constant )
            int alt13=2;
            try { dbg.enterSubRule(13);
            try { dbg.enterDecision(13, decisionCanBacktrack[13]);

            int LA13_0 = input.LA(1);

            if ( (LA13_0==ID) ) {
                alt13=1;
            }
            else if ( (LA13_0==BOOL||LA13_0==NUMBER||LA13_0==STRING) ) {
                alt13=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 13, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }
            } finally {dbg.exitDecision(13);}

            switch (alt13) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:3: ID
                    {
                    dbg.location(61,3);
                    ID47=(Token)match(input,ID,FOLLOW_ID_in_comparison399); 
                    ID47_tree = 
                    (CommonTree)adaptor.create(ID47)
                    ;
                    adaptor.addChild(root_0, ID47_tree);


                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:6: constant
                    {
                    dbg.location(61,6);
                    pushFollow(FOLLOW_constant_in_comparison401);
                    constant48=constant();

                    state._fsp--;

                    adaptor.addChild(root_0, constant48.getTree());

                    }
                    break;

            }
            } finally {dbg.exitSubRule(13);}

            dbg.location(61,16);
            RELOP49=(Token)match(input,RELOP,FOLLOW_RELOP_in_comparison404); 
            RELOP49_tree = 
            (CommonTree)adaptor.create(RELOP49)
            ;
            adaptor.addChild(root_0, RELOP49_tree);

            dbg.location(61,22);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:22: ( ID | constant )
            int alt14=2;
            try { dbg.enterSubRule(14);
            try { dbg.enterDecision(14, decisionCanBacktrack[14]);

            int LA14_0 = input.LA(1);

            if ( (LA14_0==ID) ) {
                alt14=1;
            }
            else if ( (LA14_0==BOOL||LA14_0==NUMBER||LA14_0==STRING) ) {
                alt14=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 14, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }
            } finally {dbg.exitDecision(14);}

            switch (alt14) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:23: ID
                    {
                    dbg.location(61,23);
                    ID50=(Token)match(input,ID,FOLLOW_ID_in_comparison407); 
                    ID50_tree = 
                    (CommonTree)adaptor.create(ID50)
                    ;
                    adaptor.addChild(root_0, ID50_tree);


                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:61:26: constant
                    {
                    dbg.location(61,26);
                    pushFollow(FOLLOW_constant_in_comparison409);
                    constant51=constant();

                    state._fsp--;

                    adaptor.addChild(root_0, constant51.getTree());

                    }
                    break;

            }
            } finally {dbg.exitSubRule(14);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(61, 34);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "comparison");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "comparison"


    public static class ifStat_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "ifStat"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:64:1: ifStat : 'if' comparison 'then' t= statement ( 'else' e= statement )? 'fi' -> ^( IF ^( CONDITION comparison ) ^( THEN $t) ( ^( ELSE $e) )? ) ;
    public final MiniPnASTParser.ifStat_return ifStat() throws RecognitionException {
        MiniPnASTParser.ifStat_return retval = new MiniPnASTParser.ifStat_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token string_literal52=null;
        Token string_literal54=null;
        Token string_literal55=null;
        Token string_literal56=null;
        MiniPnASTParser.statement_return t =null;

        MiniPnASTParser.statement_return e =null;

        MiniPnASTParser.comparison_return comparison53 =null;


        CommonTree string_literal52_tree=null;
        CommonTree string_literal54_tree=null;
        CommonTree string_literal55_tree=null;
        CommonTree string_literal56_tree=null;
        RewriteRuleTokenStream stream_30=new RewriteRuleTokenStream(adaptor,"token 30");
        RewriteRuleTokenStream stream_41=new RewriteRuleTokenStream(adaptor,"token 41");
        RewriteRuleTokenStream stream_32=new RewriteRuleTokenStream(adaptor,"token 32");
        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_comparison=new RewriteRuleSubtreeStream(adaptor,"rule comparison");
        try { dbg.enterRule(getGrammarFileName(), "ifStat");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(64, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:64:9: ( 'if' comparison 'then' t= statement ( 'else' e= statement )? 'fi' -> ^( IF ^( CONDITION comparison ) ^( THEN $t) ( ^( ELSE $e) )? ) )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:64:11: 'if' comparison 'then' t= statement ( 'else' e= statement )? 'fi'
            {
            dbg.location(64,11);
            string_literal52=(Token)match(input,33,FOLLOW_33_in_ifStat420);  
            stream_33.add(string_literal52);

            dbg.location(64,16);
            pushFollow(FOLLOW_comparison_in_ifStat422);
            comparison53=comparison();

            state._fsp--;

            stream_comparison.add(comparison53.getTree());
            dbg.location(64,27);
            string_literal54=(Token)match(input,41,FOLLOW_41_in_ifStat424);  
            stream_41.add(string_literal54);

            dbg.location(64,35);
            pushFollow(FOLLOW_statement_in_ifStat428);
            t=statement();

            state._fsp--;

            stream_statement.add(t.getTree());
            dbg.location(64,46);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:64:46: ( 'else' e= statement )?
            int alt15=2;
            try { dbg.enterSubRule(15);
            try { dbg.enterDecision(15, decisionCanBacktrack[15]);

            int LA15_0 = input.LA(1);

            if ( (LA15_0==30) ) {
                alt15=1;
            }
            } finally {dbg.exitDecision(15);}

            switch (alt15) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:64:47: 'else' e= statement
                    {
                    dbg.location(64,47);
                    string_literal55=(Token)match(input,30,FOLLOW_30_in_ifStat431);  
                    stream_30.add(string_literal55);

                    dbg.location(64,55);
                    pushFollow(FOLLOW_statement_in_ifStat435);
                    e=statement();

                    state._fsp--;

                    stream_statement.add(e.getTree());

                    }
                    break;

            }
            } finally {dbg.exitSubRule(15);}

            dbg.location(64,68);
            string_literal56=(Token)match(input,32,FOLLOW_32_in_ifStat439);  
            stream_32.add(string_literal56);


            // AST REWRITE
            // elements: e, comparison, t
            // token labels: 
            // rule labels: retval, t, e
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
            RewriteRuleSubtreeStream stream_t=new RewriteRuleSubtreeStream(adaptor,"rule t",t!=null?t.tree:null);
            RewriteRuleSubtreeStream stream_e=new RewriteRuleSubtreeStream(adaptor,"rule e",e!=null?e.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 65:4: -> ^( IF ^( CONDITION comparison ) ^( THEN $t) ( ^( ELSE $e) )? )
            {
                dbg.location(65,6);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:65:6: ^( IF ^( CONDITION comparison ) ^( THEN $t) ( ^( ELSE $e) )? )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                dbg.location(65,8);
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(IF, "IF")
                , root_1);

                dbg.location(65,10);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:65:10: ^( CONDITION comparison )
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(65,12);
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(CONDITION, "CONDITION")
                , root_2);

                dbg.location(65,22);
                adaptor.addChild(root_2, stream_comparison.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(65,33);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:65:33: ^( THEN $t)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(65,35);
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(THEN, "THEN")
                , root_2);

                dbg.location(65,41);
                adaptor.addChild(root_2, stream_t.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(65,44);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:65:44: ( ^( ELSE $e) )?
                if ( stream_e.hasNext() ) {
                    dbg.location(65,44);
                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:65:44: ^( ELSE $e)
                    {
                    CommonTree root_2 = (CommonTree)adaptor.nil();
                    dbg.location(65,46);
                    root_2 = (CommonTree)adaptor.becomeRoot(
                    (CommonTree)adaptor.create(ELSE, "ELSE")
                    , root_2);

                    dbg.location(65,52);
                    adaptor.addChild(root_2, stream_e.nextTree());

                    adaptor.addChild(root_1, root_2);
                    }

                }
                stream_e.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(65, 55);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "ifStat");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "ifStat"


    public static class whileStat_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "whileStat"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:67:1: whileStat : 'while' comparison 'do' ( statement )* 'od' -> ^( WHILE ^( CONDITION comparison ) ^( DO ( statement )* ) ) ;
    public final MiniPnASTParser.whileStat_return whileStat() throws RecognitionException {
        MiniPnASTParser.whileStat_return retval = new MiniPnASTParser.whileStat_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token string_literal57=null;
        Token string_literal59=null;
        Token string_literal61=null;
        MiniPnASTParser.comparison_return comparison58 =null;

        MiniPnASTParser.statement_return statement60 =null;


        CommonTree string_literal57_tree=null;
        CommonTree string_literal59_tree=null;
        CommonTree string_literal61_tree=null;
        RewriteRuleTokenStream stream_42=new RewriteRuleTokenStream(adaptor,"token 42");
        RewriteRuleTokenStream stream_35=new RewriteRuleTokenStream(adaptor,"token 35");
        RewriteRuleTokenStream stream_29=new RewriteRuleTokenStream(adaptor,"token 29");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_comparison=new RewriteRuleSubtreeStream(adaptor,"rule comparison");
        try { dbg.enterRule(getGrammarFileName(), "whileStat");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(67, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:67:11: ( 'while' comparison 'do' ( statement )* 'od' -> ^( WHILE ^( CONDITION comparison ) ^( DO ( statement )* ) ) )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:67:12: 'while' comparison 'do' ( statement )* 'od'
            {
            dbg.location(67,12);
            string_literal57=(Token)match(input,42,FOLLOW_42_in_whileStat473);  
            stream_42.add(string_literal57);

            dbg.location(67,20);
            pushFollow(FOLLOW_comparison_in_whileStat475);
            comparison58=comparison();

            state._fsp--;

            stream_comparison.add(comparison58.getTree());
            dbg.location(67,31);
            string_literal59=(Token)match(input,29,FOLLOW_29_in_whileStat477);  
            stream_29.add(string_literal59);

            dbg.location(67,36);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:67:36: ( statement )*
            try { dbg.enterSubRule(16);

            loop16:
            do {
                int alt16=2;
                try { dbg.enterDecision(16, decisionCanBacktrack[16]);

                int LA16_0 = input.LA(1);

                if ( (LA16_0==ID||LA16_0==33||LA16_0==36||LA16_0==38||LA16_0==42) ) {
                    alt16=1;
                }


                } finally {dbg.exitDecision(16);}

                switch (alt16) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:67:36: statement
            	    {
            	    dbg.location(67,36);
            	    pushFollow(FOLLOW_statement_in_whileStat479);
            	    statement60=statement();

            	    state._fsp--;

            	    stream_statement.add(statement60.getTree());

            	    }
            	    break;

            	default :
            	    break loop16;
                }
            } while (true);
            } finally {dbg.exitSubRule(16);}

            dbg.location(67,47);
            string_literal61=(Token)match(input,35,FOLLOW_35_in_whileStat482);  
            stream_35.add(string_literal61);


            // AST REWRITE
            // elements: statement, comparison
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 68:4: -> ^( WHILE ^( CONDITION comparison ) ^( DO ( statement )* ) )
            {
                dbg.location(68,6);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:68:6: ^( WHILE ^( CONDITION comparison ) ^( DO ( statement )* ) )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                dbg.location(68,8);
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(WHILE, "WHILE")
                , root_1);

                dbg.location(68,13);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:68:13: ^( CONDITION comparison )
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(68,15);
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(CONDITION, "CONDITION")
                , root_2);

                dbg.location(68,25);
                adaptor.addChild(root_2, stream_comparison.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(68,37);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:68:37: ^( DO ( statement )* )
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(68,39);
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(DO, "DO")
                , root_2);

                dbg.location(68,42);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:68:42: ( statement )*
                while ( stream_statement.hasNext() ) {
                    dbg.location(68,42);
                    adaptor.addChild(root_2, stream_statement.nextTree());

                }
                stream_statement.reset();

                adaptor.addChild(root_1, root_2);
                }

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(68, 53);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "whileStat");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "whileStat"


    public static class readStat_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "readStat"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:73:1: readStat : 'read' POPEN ID PCLOSED -> ^( READ ID ) ;
    public final MiniPnASTParser.readStat_return readStat() throws RecognitionException {
        MiniPnASTParser.readStat_return retval = new MiniPnASTParser.readStat_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token string_literal62=null;
        Token POPEN63=null;
        Token ID64=null;
        Token PCLOSED65=null;

        CommonTree string_literal62_tree=null;
        CommonTree POPEN63_tree=null;
        CommonTree ID64_tree=null;
        CommonTree PCLOSED65_tree=null;
        RewriteRuleTokenStream stream_PCLOSED=new RewriteRuleTokenStream(adaptor,"token PCLOSED");
        RewriteRuleTokenStream stream_POPEN=new RewriteRuleTokenStream(adaptor,"token POPEN");
        RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");

        try { dbg.enterRule(getGrammarFileName(), "readStat");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(73, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:73:10: ( 'read' POPEN ID PCLOSED -> ^( READ ID ) )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:73:12: 'read' POPEN ID PCLOSED
            {
            dbg.location(73,12);
            string_literal62=(Token)match(input,38,FOLLOW_38_in_readStat515);  
            stream_38.add(string_literal62);

            dbg.location(73,20);
            POPEN63=(Token)match(input,POPEN,FOLLOW_POPEN_in_readStat518);  
            stream_POPEN.add(POPEN63);

            dbg.location(73,26);
            ID64=(Token)match(input,ID,FOLLOW_ID_in_readStat520);  
            stream_ID.add(ID64);

            dbg.location(73,29);
            PCLOSED65=(Token)match(input,PCLOSED,FOLLOW_PCLOSED_in_readStat522);  
            stream_PCLOSED.add(PCLOSED65);


            // AST REWRITE
            // elements: ID
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 74:4: -> ^( READ ID )
            {
                dbg.location(74,6);
                // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:74:6: ^( READ ID )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                dbg.location(74,8);
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(READ, "READ")
                , root_1);

                dbg.location(74,13);
                adaptor.addChild(root_1, 
                stream_ID.nextNode()
                );

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(75, 0);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "readStat");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "readStat"


    public static class printStat_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "printStat"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:77:1: printStat : ( 'println' POPEN ID PCLOSED -> ^( PRINT ID ) | 'println' POPEN stringConst PCLOSED -> ^( PRINT stringConst ) );
    public final MiniPnASTParser.printStat_return printStat() throws RecognitionException {
        MiniPnASTParser.printStat_return retval = new MiniPnASTParser.printStat_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token string_literal66=null;
        Token POPEN67=null;
        Token ID68=null;
        Token PCLOSED69=null;
        Token string_literal70=null;
        Token POPEN71=null;
        Token PCLOSED73=null;
        MiniPnASTParser.stringConst_return stringConst72 =null;


        CommonTree string_literal66_tree=null;
        CommonTree POPEN67_tree=null;
        CommonTree ID68_tree=null;
        CommonTree PCLOSED69_tree=null;
        CommonTree string_literal70_tree=null;
        CommonTree POPEN71_tree=null;
        CommonTree PCLOSED73_tree=null;
        RewriteRuleTokenStream stream_PCLOSED=new RewriteRuleTokenStream(adaptor,"token PCLOSED");
        RewriteRuleTokenStream stream_POPEN=new RewriteRuleTokenStream(adaptor,"token POPEN");
        RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_36=new RewriteRuleTokenStream(adaptor,"token 36");
        RewriteRuleSubtreeStream stream_stringConst=new RewriteRuleSubtreeStream(adaptor,"rule stringConst");
        try { dbg.enterRule(getGrammarFileName(), "printStat");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(77, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:77:11: ( 'println' POPEN ID PCLOSED -> ^( PRINT ID ) | 'println' POPEN stringConst PCLOSED -> ^( PRINT stringConst ) )
            int alt17=2;
            try { dbg.enterDecision(17, decisionCanBacktrack[17]);

            int LA17_0 = input.LA(1);

            if ( (LA17_0==36) ) {
                int LA17_1 = input.LA(2);

                if ( (LA17_1==POPEN) ) {
                    int LA17_2 = input.LA(3);

                    if ( (LA17_2==ID) ) {
                        alt17=1;
                    }
                    else if ( (LA17_2==STRING) ) {
                        alt17=2;
                    }
                    else {
                        NoViableAltException nvae =
                            new NoViableAltException("", 17, 2, input);

                        dbg.recognitionException(nvae);
                        throw nvae;

                    }
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 17, 1, input);

                    dbg.recognitionException(nvae);
                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }
            } finally {dbg.exitDecision(17);}

            switch (alt17) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:77:13: 'println' POPEN ID PCLOSED
                    {
                    dbg.location(77,13);
                    string_literal66=(Token)match(input,36,FOLLOW_36_in_printStat541);  
                    stream_36.add(string_literal66);

                    dbg.location(77,23);
                    POPEN67=(Token)match(input,POPEN,FOLLOW_POPEN_in_printStat543);  
                    stream_POPEN.add(POPEN67);

                    dbg.location(77,29);
                    ID68=(Token)match(input,ID,FOLLOW_ID_in_printStat545);  
                    stream_ID.add(ID68);

                    dbg.location(77,32);
                    PCLOSED69=(Token)match(input,PCLOSED,FOLLOW_PCLOSED_in_printStat547);  
                    stream_PCLOSED.add(PCLOSED69);


                    // AST REWRITE
                    // elements: ID
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 77:40: -> ^( PRINT ID )
                    {
                        dbg.location(77,42);
                        // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:77:42: ^( PRINT ID )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        dbg.location(77,44);
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(PRINT, "PRINT")
                        , root_1);

                        dbg.location(77,50);
                        adaptor.addChild(root_1, 
                        stream_ID.nextNode()
                        );

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:78:4: 'println' POPEN stringConst PCLOSED
                    {
                    dbg.location(78,4);
                    string_literal70=(Token)match(input,36,FOLLOW_36_in_printStat559);  
                    stream_36.add(string_literal70);

                    dbg.location(78,13);
                    POPEN71=(Token)match(input,POPEN,FOLLOW_POPEN_in_printStat560);  
                    stream_POPEN.add(POPEN71);

                    dbg.location(78,19);
                    pushFollow(FOLLOW_stringConst_in_printStat562);
                    stringConst72=stringConst();

                    state._fsp--;

                    stream_stringConst.add(stringConst72.getTree());
                    dbg.location(78,31);
                    PCLOSED73=(Token)match(input,PCLOSED,FOLLOW_PCLOSED_in_printStat564);  
                    stream_PCLOSED.add(PCLOSED73);


                    // AST REWRITE
                    // elements: stringConst
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 78:39: -> ^( PRINT stringConst )
                    {
                        dbg.location(78,41);
                        // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:78:41: ^( PRINT stringConst )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        dbg.location(78,43);
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(PRINT, "PRINT")
                        , root_1);

                        dbg.location(78,49);
                        adaptor.addChild(root_1, stream_stringConst.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(79, 1);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "printStat");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "printStat"


    public static class intConst_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "intConst"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:83:1: intConst : ( NUMBER )+ ;
    public final MiniPnASTParser.intConst_return intConst() throws RecognitionException {
        MiniPnASTParser.intConst_return retval = new MiniPnASTParser.intConst_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token NUMBER74=null;

        CommonTree NUMBER74_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "intConst");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(83, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:83:10: ( ( NUMBER )+ )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:83:12: ( NUMBER )+
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(83,12);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:83:12: ( NUMBER )+
            int cnt18=0;
            try { dbg.enterSubRule(18);

            loop18:
            do {
                int alt18=2;
                try { dbg.enterDecision(18, decisionCanBacktrack[18]);

                int LA18_0 = input.LA(1);

                if ( (LA18_0==NUMBER) ) {
                    alt18=1;
                }


                } finally {dbg.exitDecision(18);}

                switch (alt18) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:83:12: NUMBER
            	    {
            	    dbg.location(83,12);
            	    NUMBER74=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_intConst583); 
            	    NUMBER74_tree = 
            	    (CommonTree)adaptor.create(NUMBER74)
            	    ;
            	    adaptor.addChild(root_0, NUMBER74_tree);


            	    }
            	    break;

            	default :
            	    if ( cnt18 >= 1 ) break loop18;
                        EarlyExitException eee =
                            new EarlyExitException(18, input);
                        dbg.recognitionException(eee);

                        throw eee;
                }
                cnt18++;
            } while (true);
            } finally {dbg.exitSubRule(18);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(83, 18);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "intConst");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "intConst"


    public static class stringConst_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "stringConst"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:86:1: stringConst : STRING ;
    public final MiniPnASTParser.stringConst_return stringConst() throws RecognitionException {
        MiniPnASTParser.stringConst_return retval = new MiniPnASTParser.stringConst_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token STRING75=null;

        CommonTree STRING75_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "stringConst");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(86, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:87:5: ( STRING )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:87:8: STRING
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(87,8);
            STRING75=(Token)match(input,STRING,FOLLOW_STRING_in_stringConst598); 
            STRING75_tree = 
            (CommonTree)adaptor.create(STRING75)
            ;
            adaptor.addChild(root_0, STRING75_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(88, 4);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "stringConst");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "stringConst"


    public static class realConst_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "realConst"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:89:1: realConst : ( NUMBER )+ '.' ( NUMBER )* ;
    public final MiniPnASTParser.realConst_return realConst() throws RecognitionException {
        MiniPnASTParser.realConst_return retval = new MiniPnASTParser.realConst_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token NUMBER76=null;
        Token char_literal77=null;
        Token NUMBER78=null;

        CommonTree NUMBER76_tree=null;
        CommonTree char_literal77_tree=null;
        CommonTree NUMBER78_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "realConst");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(89, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:5: ( ( NUMBER )+ '.' ( NUMBER )* )
            dbg.enterAlt(1);

            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:9: ( NUMBER )+ '.' ( NUMBER )*
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(90,9);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:9: ( NUMBER )+
            int cnt19=0;
            try { dbg.enterSubRule(19);

            loop19:
            do {
                int alt19=2;
                try { dbg.enterDecision(19, decisionCanBacktrack[19]);

                int LA19_0 = input.LA(1);

                if ( (LA19_0==NUMBER) ) {
                    alt19=1;
                }


                } finally {dbg.exitDecision(19);}

                switch (alt19) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:9: NUMBER
            	    {
            	    dbg.location(90,9);
            	    NUMBER76=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_realConst616); 
            	    NUMBER76_tree = 
            	    (CommonTree)adaptor.create(NUMBER76)
            	    ;
            	    adaptor.addChild(root_0, NUMBER76_tree);


            	    }
            	    break;

            	default :
            	    if ( cnt19 >= 1 ) break loop19;
                        EarlyExitException eee =
                            new EarlyExitException(19, input);
                        dbg.recognitionException(eee);

                        throw eee;
                }
                cnt19++;
            } while (true);
            } finally {dbg.exitSubRule(19);}

            dbg.location(90,17);
            char_literal77=(Token)match(input,26,FOLLOW_26_in_realConst619); 
            char_literal77_tree = 
            (CommonTree)adaptor.create(char_literal77)
            ;
            adaptor.addChild(root_0, char_literal77_tree);

            dbg.location(90,21);
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:21: ( NUMBER )*
            try { dbg.enterSubRule(20);

            loop20:
            do {
                int alt20=2;
                try { dbg.enterDecision(20, decisionCanBacktrack[20]);

                int LA20_0 = input.LA(1);

                if ( (LA20_0==NUMBER) ) {
                    alt20=1;
                }


                } finally {dbg.exitDecision(20);}

                switch (alt20) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:90:21: NUMBER
            	    {
            	    dbg.location(90,21);
            	    NUMBER78=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_realConst621); 
            	    NUMBER78_tree = 
            	    (CommonTree)adaptor.create(NUMBER78)
            	    ;
            	    adaptor.addChild(root_0, NUMBER78_tree);


            	    }
            	    break;

            	default :
            	    break loop20;
                }
            } while (true);
            } finally {dbg.exitSubRule(20);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(91, 4);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "realConst");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "realConst"


    public static class constant_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "constant"
    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:94:1: constant : ( stringConst | BOOL realConst | intConst );
    public final MiniPnASTParser.constant_return constant() throws RecognitionException {
        MiniPnASTParser.constant_return retval = new MiniPnASTParser.constant_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token BOOL80=null;
        MiniPnASTParser.stringConst_return stringConst79 =null;

        MiniPnASTParser.realConst_return realConst81 =null;

        MiniPnASTParser.intConst_return intConst82 =null;


        CommonTree BOOL80_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "constant");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(94, 0);

        try {
            // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:94:9: ( stringConst | BOOL realConst | intConst )
            int alt21=3;
            try { dbg.enterDecision(21, decisionCanBacktrack[21]);

            switch ( input.LA(1) ) {
            case STRING:
                {
                alt21=1;
                }
                break;
            case BOOL:
                {
                alt21=2;
                }
                break;
            case NUMBER:
                {
                alt21=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 21, 0, input);

                dbg.recognitionException(nvae);
                throw nvae;

            }

            } finally {dbg.exitDecision(21);}

            switch (alt21) {
                case 1 :
                    dbg.enterAlt(1);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:94:11: stringConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(94,11);
                    pushFollow(FOLLOW_stringConst_in_constant635);
                    stringConst79=stringConst();

                    state._fsp--;

                    adaptor.addChild(root_0, stringConst79.getTree());

                    }
                    break;
                case 2 :
                    dbg.enterAlt(2);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:94:24: BOOL realConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(94,24);
                    BOOL80=(Token)match(input,BOOL,FOLLOW_BOOL_in_constant638); 
                    BOOL80_tree = 
                    (CommonTree)adaptor.create(BOOL80)
                    ;
                    adaptor.addChild(root_0, BOOL80_tree);

                    dbg.location(94,29);
                    pushFollow(FOLLOW_realConst_in_constant640);
                    realConst81=realConst();

                    state._fsp--;

                    adaptor.addChild(root_0, realConst81.getTree());

                    }
                    break;
                case 3 :
                    dbg.enterAlt(3);

                    // /Users/andreredenius/Dropbox/UNI/CI/CI Praktikum 2/MiniPnAST.g:94:39: intConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    dbg.location(94,39);
                    pushFollow(FOLLOW_intConst_in_constant642);
                    intConst82=intConst();

                    state._fsp--;

                    adaptor.addChild(root_0, intConst82.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(94, 48);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "constant");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "constant"

    // Delegated rules


    protected DFA9 dfa9 = new DFA9(this);
    static final String DFA9_eotS =
        "\11\uffff";
    static final String DFA9_eofS =
        "\11\uffff";
    static final String DFA9_minS =
        "\1\13\1\7\1\4\2\13\1\uffff\1\13\2\uffff";
    static final String DFA9_maxS =
        "\1\13\1\7\1\26\2\52\1\uffff\1\52\2\uffff";
    static final String DFA9_acceptS =
        "\5\uffff\1\2\1\uffff\1\3\1\1";
    static final String DFA9_specialS =
        "\11\uffff}>";
    static final String[] DFA9_transitionS = {
            "\1\1",
            "\1\2",
            "\1\5\6\uffff\1\4\2\uffff\1\6\2\uffff\1\7\4\uffff\1\3",
            "\1\10\10\uffff\1\5\11\uffff\4\10\1\uffff\2\10\1\uffff\1\10"+
            "\3\uffff\1\10",
            "\1\7\1\uffff\1\7\2\uffff\1\7\3\uffff\1\5\11\uffff\4\7\1\uffff"+
            "\2\7\1\uffff\1\7\3\uffff\1\7",
            "",
            "\1\7\1\uffff\1\7\1\6\1\uffff\1\7\3\uffff\1\5\11\uffff\4\7\1"+
            "\uffff\2\7\1\uffff\1\7\3\uffff\1\7",
            "",
            ""
    };

    static final short[] DFA9_eot = DFA.unpackEncodedString(DFA9_eotS);
    static final short[] DFA9_eof = DFA.unpackEncodedString(DFA9_eofS);
    static final char[] DFA9_min = DFA.unpackEncodedStringToUnsignedChars(DFA9_minS);
    static final char[] DFA9_max = DFA.unpackEncodedStringToUnsignedChars(DFA9_maxS);
    static final short[] DFA9_accept = DFA.unpackEncodedString(DFA9_acceptS);
    static final short[] DFA9_special = DFA.unpackEncodedString(DFA9_specialS);
    static final short[][] DFA9_transition;

    static {
        int numStates = DFA9_transitionS.length;
        DFA9_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA9_transition[i] = DFA.unpackEncodedString(DFA9_transitionS[i]);
        }
    }

    class DFA9 extends DFA {

        public DFA9(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 9;
            this.eot = DFA9_eot;
            this.eof = DFA9_eof;
            this.min = DFA9_min;
            this.max = DFA9_max;
            this.accept = DFA9_accept;
            this.special = DFA9_special;
            this.transition = DFA9_transition;
        }
        public String getDescription() {
            return "42:1: assignment : ( ID DECLA ( stringConst ) -> ^( DECLA ID stringConst ) | ID DECLA ( comparison ) -> ^( DECLA ID comparison ) | ID DECLA ( arithExpr ) -> ^( DECLA ID arithExpr ) );";
        }
        public void error(NoViableAltException nvae) {
            dbg.recognitionException(nvae);
        }
    }
 

    public static final BitSet FOLLOW_37_in_prog60 = new BitSet(new long[]{0x0000018418000000L});
    public static final BitSet FOLLOW_declaration_in_prog63 = new BitSet(new long[]{0x0000018418000000L});
    public static final BitSet FOLLOW_27_in_prog67 = new BitSet(new long[]{0x0000045280000800L});
    public static final BitSet FOLLOW_statement_in_prog70 = new BitSet(new long[]{0x0000045280000800L});
    public static final BitSet FOLLOW_31_in_prog74 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_34_in_declaration102 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration105 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_25_in_declaration107 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration108 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_SEMI_in_declaration112 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_28_in_declaration131 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration134 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_25_in_declaration136 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration137 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_SEMI_in_declaration141 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_40_in_declaration159 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration162 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_25_in_declaration164 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration165 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_SEMI_in_declaration169 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_39_in_declaration187 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration190 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_25_in_declaration192 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_declaration193 = new BitSet(new long[]{0x0000000002200000L});
    public static final BitSet FOLLOW_SEMI_in_declaration197 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignment_in_statement218 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ifStat_in_statement224 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_whileStat_in_statement237 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_readStat_in_statement244 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_printStat_in_statement250 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_assignment261 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_DECLA_in_assignment263 = new BitSet(new long[]{0x0000000000400000L});
    public static final BitSet FOLLOW_stringConst_in_assignment266 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_assignment283 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_DECLA_in_assignment285 = new BitSet(new long[]{0x0000000000404810L});
    public static final BitSet FOLLOW_comparison_in_assignment288 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_assignment306 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_DECLA_in_assignment308 = new BitSet(new long[]{0x0000000000024800L});
    public static final BitSet FOLLOW_arithExpr_in_assignment311 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_pointExpr_in_arithExpr337 = new BitSet(new long[]{0x0000000000002002L});
    public static final BitSet FOLLOW_LINEOP_in_arithExpr340 = new BitSet(new long[]{0x0000000000024800L});
    public static final BitSet FOLLOW_pointExpr_in_arithExpr342 = new BitSet(new long[]{0x0000000000002002L});
    public static final BitSet FOLLOW_atom_in_pointExpr351 = new BitSet(new long[]{0x0000000000010002L});
    public static final BitSet FOLLOW_POINTOP_in_pointExpr354 = new BitSet(new long[]{0x0000000000024800L});
    public static final BitSet FOLLOW_atom_in_pointExpr356 = new BitSet(new long[]{0x0000000000010002L});
    public static final BitSet FOLLOW_intConst_in_atom366 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_atom371 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_POPEN_in_atom379 = new BitSet(new long[]{0x0000000000024800L});
    public static final BitSet FOLLOW_arithExpr_in_atom381 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_PCLOSED_in_atom383 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_comparison399 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_constant_in_comparison401 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_RELOP_in_comparison404 = new BitSet(new long[]{0x0000000000404810L});
    public static final BitSet FOLLOW_ID_in_comparison407 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_constant_in_comparison409 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_33_in_ifStat420 = new BitSet(new long[]{0x0000000000404810L});
    public static final BitSet FOLLOW_comparison_in_ifStat422 = new BitSet(new long[]{0x0000020000000000L});
    public static final BitSet FOLLOW_41_in_ifStat424 = new BitSet(new long[]{0x0000045200000800L});
    public static final BitSet FOLLOW_statement_in_ifStat428 = new BitSet(new long[]{0x0000000140000000L});
    public static final BitSet FOLLOW_30_in_ifStat431 = new BitSet(new long[]{0x0000045200000800L});
    public static final BitSet FOLLOW_statement_in_ifStat435 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_ifStat439 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_42_in_whileStat473 = new BitSet(new long[]{0x0000000000404810L});
    public static final BitSet FOLLOW_comparison_in_whileStat475 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_whileStat477 = new BitSet(new long[]{0x0000045A00000800L});
    public static final BitSet FOLLOW_statement_in_whileStat479 = new BitSet(new long[]{0x0000045A00000800L});
    public static final BitSet FOLLOW_35_in_whileStat482 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_38_in_readStat515 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_POPEN_in_readStat518 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_readStat520 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_PCLOSED_in_readStat522 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_36_in_printStat541 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_POPEN_in_printStat543 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_ID_in_printStat545 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_PCLOSED_in_printStat547 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_36_in_printStat559 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_POPEN_in_printStat560 = new BitSet(new long[]{0x0000000000400000L});
    public static final BitSet FOLLOW_stringConst_in_printStat562 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_PCLOSED_in_printStat564 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMBER_in_intConst583 = new BitSet(new long[]{0x0000000000004002L});
    public static final BitSet FOLLOW_STRING_in_stringConst598 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMBER_in_realConst616 = new BitSet(new long[]{0x0000000004004000L});
    public static final BitSet FOLLOW_26_in_realConst619 = new BitSet(new long[]{0x0000000000004002L});
    public static final BitSet FOLLOW_NUMBER_in_realConst621 = new BitSet(new long[]{0x0000000000004002L});
    public static final BitSet FOLLOW_stringConst_in_constant635 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_BOOL_in_constant638 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_realConst_in_constant640 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_intConst_in_constant642 = new BitSet(new long[]{0x0000000000000002L});

}